<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li :class="{completed:obj.isDone}" v-for="obj in arr" :key="obj.id">
      <div class="view">
        <input class="toggle" type="checkbox" v-model="obj.isDone" />
        <label>{{ obj.name }}</label>
        <!-- 是那个隐藏的按钮 -->
        <!-- <span>{{obj}}</span> -->
        <button class="destroy" @click="delFn(obj.id)"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  props: {
    arr: {
      type: Array
    }
  },
  methods: {
    delFn(id) {
      this.$emit("del", id);
    }
  }
};
</script>